package com.oil.petro.eshop.bean;

public class Page implements Comparable<Page> {

    String number;
    String link;
    String style;

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public Page(String number, String link) {
        this.number = number;
        this.link = link;
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    @Override
    public int compareTo(Page p) {

        if ("&laquo;".equals(number)) {
            return -1;
        };
        if ("&raquo;".equals(number)) {
            return 1;
        };

        if (number.hashCode() > p.number.hashCode()) {
            return 1;
        } else if (number.hashCode() < p.number.hashCode()) {
            return -1;
        } else {
            return 0;
        }

    }

////    @Override
////    public int compareTo(Page page) {
////        int porownaneNazwiska = nazwisko.compareTo(o.nazwisko);
//// 
////        if(porownaneNazwiska == 0) {
////            return imie.compareTo(o.imie);
////        }
////        else {
////            return porownaneNazwiska;
////        }
////    }
////int result = this.name.compareTo(jedi.getName());
////    if(result == 0){
////        result = this.age > jedi.age ? 1 : this.age < jedi.age ? -1 : 0;
////    }
////    return result;
////}
////    
}
